package com.zsl.swing.redis.desktop.window.panel;

import javax.swing.*;
import javax.swing.border.Border;
import javax.swing.plaf.basic.BasicSplitPaneDivider;
import javax.swing.plaf.basic.BasicSplitPaneUI;
import java.awt.*;

public class ZslSplitPane  extends JSplitPane {

    public ZslSplitPane(){
        super();
    }
    public ZslSplitPane(int newOrientation, int dividerSize, Component left, Component right) {
        super(newOrientation, true, left, right);

        this.setDividerSize(dividerSize);
        this.initPane();

    }

    private void initPane() {
        this.setUI(new BasicSplitPaneUI(){

            public BasicSplitPaneDivider createDefaultDivider() {
                return new BasicSplitPaneDivider(this) {


                    @Override
                    public void setBorder(Border b) {
                    }

                    @Override
                    public void paint(Graphics g) {
                        g.setColor(Color.WHITE);
                        g.fillRect(0, 0, getSize().width, getSize().height);
                        super.paint(g);
                    }
                };
            }

        });
    }

}
